package com.hmtech.ayp.common.s3.enums;

import com.hmtech.ayp.common.resp.IResultCode;

/**
 * @author 闫家洪（yanjiahong@vcredit.com）
 * @since 2023/12/20
 */
public enum S3ErrorEnum implements IResultCode {
    S3_KEY_IS_INVALID(400040001, "S3 key is invalid!"),
    S3_PATH_IS_BLANK(400040001, "S3 path can not be blank!"),
    PRE_SIGN_METHOD_IS_INVALID(400040001, "Pre sign method is invalid!"),

    S3_UPLOAD_ERROR(500040001, "Upload file to S3 error!"),
    PRE_SIGN_ERROR(500040002, "Generating pre signed S3 object url error!"),
    CREATE_URL_FAIL(500040003, "Fail to create download url"),
    ;

    public final int code;
    public final String message;

    S3ErrorEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
